<?php

namespace app\api\controller;

use app\common\model\User;

class UserController extends BaseApiController
{
    public function getUserInfo()
    {
        $user = (new User())->with('fans')->where("id", $this->user["id"])->find();
        $this->successReturn($user);
    }

    public function updateUserInfo()
    {
        User::update([
            "name" => input("name"),
            "phone" => input("phone"),
            "avatar" => input("avatar")
        ], ["id" => $this->user["id"]]);
        $this->successReturn();
    }

}